﻿#pragma strict

public var speed = 55.0;
private var rotation = 0.0;
private var qTo = Quaternion.identity;
 
 
function Update () {
 
    if (Input.GetKeyDown(KeyCode.A)) {
        rotation += 90.0;
        qTo = Quaternion.Euler(0.0, 0.0, rotation);
 
    }
     if (Input.GetKeyDown(KeyCode.S)) {
        rotation -= 90;
       qTo = Quaternion.Euler(0.0, 0.0, rotation);
    }
 
    transform.rotation = Quaternion.RotateTowards(transform.rotation, qTo, speed * Time.deltaTime);
 
}